﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:ProgressBarTest="clr-namespace:ProgressBarTest"
                    mc:Ignorable="d">
    <!-- Resource dictionary entries should be defined here. -->
    <Style x:Key="CircleProgressBarStyle"
           TargetType="{x:Type ProgressBarTest:CircularProgressBar}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <Grid SnapsToDevicePixels="true"
                          DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ProgressBarTest:CircularProgressBar}}}" RenderTransformOrigin="0.5,0.5">
                    	<Grid.RenderTransform>
                    		<TransformGroup>
                    			<ScaleTransform/>
                    			<SkewTransform/>
                    			<RotateTransform Angle="90"/>
                    			<TranslateTransform/>
                    		</TransformGroup>
                    	</Grid.RenderTransform>
                        <Ellipse>
                        	<Ellipse.Fill>
                        		<RadialGradientBrush>
									<GradientStop Color="#FFBABABA" Offset=".87"/>
            						<GradientStop Color="#FFC7C7C7" Offset="0.94"/>
            						<GradientStop Color="#FFBABABA" Offset="1"/>
									<!--
                        			<GradientStop Color="#FF202020" Offset=".87"/>
                        			<GradientStop Color="#FF747474" Offset=".9"/>
									<GradientStop Color="#FF747474" Offset=".97"/>
									<GradientStop Color="#FF202020" Offset="1"/>
									-->
                        		</RadialGradientBrush>
                        	</Ellipse.Fill>
							<Ellipse.Clip>
								<CombinedGeometry GeometryCombineMode="Exclude">
									<CombinedGeometry.Geometry1>
										<EllipseGeometry Center="75,75" RadiusX="74" RadiusY="74" />
									</CombinedGeometry.Geometry1>
									<CombinedGeometry.Geometry2>
										<EllipseGeometry Center="75,75" RadiusX="66" RadiusY="66" />
									</CombinedGeometry.Geometry2>
								</CombinedGeometry>
							</Ellipse.Clip>
						</Ellipse>
                        <Ellipse Fill="{TemplateBinding Foreground}">
                        	<!--<Ellipse.Fill>
                        		<RadialGradientBrush>
                        			<GradientStop Color="#FF646464" Offset=".87"/>
                        			<GradientStop Color="#FF01D328" Offset=".9"/>
                        			<GradientStop Color="#FF01D328" Offset=".97"/>
                        			<GradientStop Color="#FF646464" Offset="1"/>
                        		</RadialGradientBrush>
                        	</Ellipse.Fill>-->
                        	<Ellipse.Clip>
                        		<CombinedGeometry GeometryCombineMode="Exclude">
                        			<CombinedGeometry.Geometry1>
                        				<PathGeometry>
                        					<PathFigure StartPoint="0,0">
                        						<LineSegment Point="0,75" />
                        						<LineSegment Point="75,75" />
                        						<LineSegment Point="{Binding ProgressPoint}" />
                        						<LineSegment Point="{Binding ThirdBoundingPoint}" />
                        						<LineSegment Point="{Binding SecondBoundingPoint}" />
                        						<LineSegment Point="{Binding FirstBoundingPoint}" />
                        					</PathFigure>
                        				</PathGeometry>
                        			</CombinedGeometry.Geometry1>
                        			<CombinedGeometry.Geometry2>
                        				<EllipseGeometry Center="75,75" RadiusX="65" RadiusY="65" />
                        			</CombinedGeometry.Geometry2>
                        		</CombinedGeometry>
                        	</Ellipse.Clip>
                        </Ellipse>
                        <Ellipse>
                        	<Ellipse.Fill>
                        		<RadialGradientBrush>
                        			<GradientStop Color="#00FFFFFF" Offset="0.949"/>
                        			<GradientStop Color="#66FFFFFF" Offset="0.95"/>
                        			<!--
                        			<GradientStop Color="#FF202020" Offset=".87"/>
                        			<GradientStop Color="#FF747474" Offset=".9"/>
									<GradientStop Color="#FF747474" Offset=".97"/>
									<GradientStop Color="#FF202020" Offset="1"/>
									-->
                        		</RadialGradientBrush>
                        	</Ellipse.Fill>
                        	<Ellipse.Clip>
                        		<CombinedGeometry GeometryCombineMode="Exclude">
                        			<CombinedGeometry.Geometry1>
                        				<EllipseGeometry Center="75,75" RadiusX="75" RadiusY="75" />
                        			</CombinedGeometry.Geometry1>
                        			<CombinedGeometry.Geometry2>
                        				<EllipseGeometry Center="75,75" RadiusX="65" RadiusY="65" />
                        			</CombinedGeometry.Geometry2>
                        		</CombinedGeometry>
                        	</Ellipse.Clip>
                        </Ellipse>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsIndeterminate"
                                 Value="true" />
                        <Trigger Property="IsIndeterminate"
                                 Value="false" />
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>